# coding:utf-8
import pymongo
from flask import Flask
from flask_cors import CORS
# from flask_mongoengine import MongoEngine
from flask_restful import Api, Resource


app = Flask(__name__)

app.config.from_object('config')
CORS(app, supports_credentials=True)

api = Api(app)

# app.config['MONGODB_SETTINGS'] = {
#     'db':   'vcourse',
#     'host': 'localhost',
#     'port': 27017
#     # 'port': 26125
# }

# db = MongoEngine(app)

myclient = pymongo.MongoClient("mongodb://localhost:27017/")
db = myclient["vcourse"]

import models

#api的业务逻辑
import controller